{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "参考链接：  \n",
    "http://www.woshipm.com/data-analysis/731593.html"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**知乎数据分析需求：**  \n",
    "\n",
    "1、知乎的男女比例？  \n",
    "2、知乎用户都是哪里人？   \n",
    "3、知乎用户的职业分布？   \n",
    "4、知乎的高校用户中，都是来自哪些高校？  \n",
    "\n",
    "**分析角度：**  \n",
    "地理位置、男女比例、各类排名、所在高校、活跃程度等"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**注意：**   \n",
    "\n",
    "- 数据抓取时间为2017年7月份，用户数据会随着时间推移而变化，所以该报告具有一定时效性。\n",
    "- 因为知乎用户有权只填写部分信息，所以用户的个人资料很大程度上是不完整的，所以后面分析的时候会筛掉对应指标为空的用户。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 了解数据\n",
    "使用pandas加载数据。\n",
    "## 查看都有哪些列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['_id', 'n_folder', 'n_follow', 'n_followed', 'n_question', 'n_topic',\n",
       "       'n_zhuanlan', 'job1', 'job2', 'ans_v', 'share_v', 'ask_v', 'store_v',\n",
       "       '个人简介', '居住地', '所在行业', '收藏夹', '教育经历', '职业经历'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "data_zhihu = pd.read_csv(\"zhihu.csv\",encoding = \"ANSI\",engine='python')\n",
    "data_zhihu.columns # 以列表的形式返回列"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**各字段含义：**  \n",
    "_id  \n",
    "n_folder  \n",
    "n_follow  \n",
    "n_followed  \n",
    "n_question  \n",
    "n_topic  \n",
    "n_zhuanlan  \n",
    "job1  \n",
    "job2  \n",
    "ans_v  \n",
    "share_v  \n",
    "ask_v  \n",
    "store_v  \n",
    "个人简介  \n",
    "居住地  \n",
    "所在行业  \n",
    "收藏夹  \n",
    "教育经历  \n",
    "职业经历  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>_id</th>\n",
       "      <th>n_folder</th>\n",
       "      <th>n_follow</th>\n",
       "      <th>n_followed</th>\n",
       "      <th>n_question</th>\n",
       "      <th>n_topic</th>\n",
       "      <th>n_zhuanlan</th>\n",
       "      <th>job1</th>\n",
       "      <th>job2</th>\n",
       "      <th>ans_v</th>\n",
       "      <th>share_v</th>\n",
       "      <th>ask_v</th>\n",
       "      <th>store_v</th>\n",
       "      <th>个人简介</th>\n",
       "      <th>居住地</th>\n",
       "      <th>所在行业</th>\n",
       "      <th>收藏夹</th>\n",
       "      <th>教育经历</th>\n",
       "      <th>职业经历</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>587598f89f11daf90617fb7a</td>\n",
       "      <td>52</td>\n",
       "      <td>17</td>\n",
       "      <td>1</td>\n",
       "      <td>30</td>\n",
       "      <td>58</td>\n",
       "      <td>2</td>\n",
       "      <td>交通仓储</td>\n",
       "      <td>邮政</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>邮政</td>\n",
       "      <td>ooxx</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>587598f89f11daf90617fb7c</td>\n",
       "      <td>27</td>\n",
       "      <td>73</td>\n",
       "      <td>15</td>\n",
       "      <td>87</td>\n",
       "      <td>26</td>\n",
       "      <td>1</td>\n",
       "      <td>高新科技</td>\n",
       "      <td>互联网</td>\n",
       "      <td>56.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>重庆</td>\n",
       "      <td>互联网</td>\n",
       "      <td>ooxx</td>\n",
       "      <td>重庆邮电大学</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>587598f89f11daf90617fb7e</td>\n",
       "      <td>72</td>\n",
       "      <td>94</td>\n",
       "      <td>1</td>\n",
       "      <td>112</td>\n",
       "      <td>20</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>ooxx</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>587598f89f11daf90617fb80</td>\n",
       "      <td>174</td>\n",
       "      <td>84</td>\n",
       "      <td>8</td>\n",
       "      <td>895</td>\n",
       "      <td>30</td>\n",
       "      <td>7</td>\n",
       "      <td>金融</td>\n",
       "      <td>财务</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>22.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>财务</td>\n",
       "      <td>ooxx</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>587598f89f11daf90617fb82</td>\n",
       "      <td>3</td>\n",
       "      <td>236</td>\n",
       "      <td>64</td>\n",
       "      <td>119</td>\n",
       "      <td>44</td>\n",
       "      <td>17</td>\n",
       "      <td>金融</td>\n",
       "      <td>证券投资</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>无求 心静 魔不生</td>\n",
       "      <td>上海</td>\n",
       "      <td>证券投资</td>\n",
       "      <td>ooxx</td>\n",
       "      <td>雪城大学（Syracuse University）</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                        _id  n_folder  n_follow  n_followed  n_question  \\\n",
       "0  587598f89f11daf90617fb7a        52        17           1          30   \n",
       "1  587598f89f11daf90617fb7c        27        73          15          87   \n",
       "2  587598f89f11daf90617fb7e        72        94           1         112   \n",
       "3  587598f89f11daf90617fb80       174        84           8         895   \n",
       "4  587598f89f11daf90617fb82         3       236          64         119   \n",
       "\n",
       "   n_topic  n_zhuanlan  job1  job2  ans_v  share_v  ask_v  store_v       个人简介  \\\n",
       "0       58           2  交通仓储    邮政    0.0      0.0    0.0      3.0        NaN   \n",
       "1       26           1  高新科技   互联网   56.0      0.0    4.0     14.0        NaN   \n",
       "2       20           4   NaN   NaN    1.0      0.0    0.0     21.0        NaN   \n",
       "3       30           7    金融    财务    0.0      0.0    0.0     22.0        NaN   \n",
       "4       44          17    金融  证券投资    6.0      0.0    0.0     12.0  无求 心静 魔不生   \n",
       "\n",
       "   居住地  所在行业   收藏夹                       教育经历 职业经历  \n",
       "0  NaN    邮政  ooxx                        NaN  NaN  \n",
       "1   重庆   互联网  ooxx                     重庆邮电大学  NaN  \n",
       "2  NaN   NaN  ooxx                        NaN  NaN  \n",
       "3  NaN    财务  ooxx                        NaN  NaN  \n",
       "4   上海  证券投资  ooxx  雪城大学（Syracuse University）  NaN  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_zhihu.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 统计各列的值\n",
    "随心所欲地统计各列的值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "高新科技    10595\n",
       "金融       4196\n",
       "制造加工     3345\n",
       "服务业      3068\n",
       "公共服务     2754\n",
       "教育       2549\n",
       "医疗服务     1426\n",
       "信息传媒     1411\n",
       "地产建筑     1249\n",
       "艺术娱乐     1166\n",
       "贸易零售      617\n",
       "交通仓储      578\n",
       "农林牧渔      462\n",
       "开采冶金      421\n",
       "Name: job1, dtype: int64"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 统计职业信息\n",
    "data_zhihu.job1.value_counts()\n",
    "# data_zhihu.job2.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 获取job1列数据为非空的所有列值\n",
    "df_job1 = data_zhihu[data_zhihu.job1.notnull()]\n",
    "# df_job1.job2.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 获取居住地列数据为非空的所有列值\n",
    "# data_zhihu[data_zhihu.居住地.notnull()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 获取job1列数据为空的所有列值\n",
    "# data_zhihu[data_zhihu.job1.isnull()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "高新科技    6115\n",
       "金融      2013\n",
       "服务业     1616\n",
       "制造加工    1608\n",
       "公共服务    1374\n",
       "教育      1172\n",
       "信息传媒     678\n",
       "地产建筑     630\n",
       "医疗服务     613\n",
       "艺术娱乐     576\n",
       "贸易零售     287\n",
       "交通仓储     268\n",
       "农林牧渔     187\n",
       "开采冶金     180\n",
       "Name: job1, dtype: int64"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 在居住地非空的前提下，统计job1的信息\n",
    "data_zhihu[data_zhihu.居住地.notnull()]['job1'].value_counts()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "由以上统计信息可知，高新科技、金融和服务业是知友从事最多的三类职业。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 集中获取各列数据的信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 72756 entries, 0 to 72755\n",
      "Data columns (total 19 columns):\n",
      "_id           72756 non-null object\n",
      "n_folder      72756 non-null int64\n",
      "n_follow      72756 non-null int64\n",
      "n_followed    72756 non-null int64\n",
      "n_question    72756 non-null int64\n",
      "n_topic       72756 non-null int64\n",
      "n_zhuanlan    72756 non-null int64\n",
      "job1          33837 non-null object\n",
      "job2          33837 non-null object\n",
      "ans_v         32346 non-null float64\n",
      "share_v       32346 non-null float64\n",
      "ask_v         32346 non-null float64\n",
      "store_v       32346 non-null float64\n",
      "个人简介          31908 non-null object\n",
      "居住地           31585 non-null object\n",
      "所在行业          41636 non-null object\n",
      "收藏夹           72756 non-null object\n",
      "教育经历          18260 non-null object\n",
      "职业经历          8679 non-null object\n",
      "dtypes: float64(4), int64(6), object(9)\n",
      "memory usage: 10.5+ MB\n"
     ]
    }
   ],
   "source": [
    "data_zhihu.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font color=red>它告诉我们，训练数据中总共有72756条，但是很操蛋的是，有些属性的数据不全，比如说：<font><br>\n",
    "\n",
    "* <font>job1、job2属性只有33837条记录<font>\n",
    "* <font>“职业经历”更是只有8679条数据<font>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  获取数值型数据的一些分布\n",
    "<font color=red>用下列的方法，得到数值型数据的一些分布。  \n",
    "(因为有些属性，比如姓名，是文本型；而另外一些属性，比如登船港口，是类目型。这些我们用下面的函数是看不到的)<font>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>n_folder</th>\n",
       "      <th>n_follow</th>\n",
       "      <th>n_followed</th>\n",
       "      <th>n_question</th>\n",
       "      <th>n_topic</th>\n",
       "      <th>n_zhuanlan</th>\n",
       "      <th>ans_v</th>\n",
       "      <th>share_v</th>\n",
       "      <th>ask_v</th>\n",
       "      <th>store_v</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>72756.000000</td>\n",
       "      <td>72756.000000</td>\n",
       "      <td>72756.000000</td>\n",
       "      <td>72756.000000</td>\n",
       "      <td>72756.000000</td>\n",
       "      <td>72756.000000</td>\n",
       "      <td>32346.000000</td>\n",
       "      <td>32346.000000</td>\n",
       "      <td>32346.000000</td>\n",
       "      <td>32346.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>166.097449</td>\n",
       "      <td>154.171697</td>\n",
       "      <td>181.636525</td>\n",
       "      <td>263.631962</td>\n",
       "      <td>47.154475</td>\n",
       "      <td>28.707900</td>\n",
       "      <td>15.140543</td>\n",
       "      <td>0.152878</td>\n",
       "      <td>1.761918</td>\n",
       "      <td>6.217461</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>722.466493</td>\n",
       "      <td>309.684321</td>\n",
       "      <td>4154.572286</td>\n",
       "      <td>943.775703</td>\n",
       "      <td>134.809435</td>\n",
       "      <td>83.416237</td>\n",
       "      <td>63.209168</td>\n",
       "      <td>2.240585</td>\n",
       "      <td>6.341811</td>\n",
       "      <td>8.313293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>9.000000</td>\n",
       "      <td>22.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>28.000000</td>\n",
       "      <td>67.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>53.000000</td>\n",
       "      <td>18.000000</td>\n",
       "      <td>8.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>86.000000</td>\n",
       "      <td>166.000000</td>\n",
       "      <td>16.000000</td>\n",
       "      <td>187.000000</td>\n",
       "      <td>45.000000</td>\n",
       "      <td>27.000000</td>\n",
       "      <td>11.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>9.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>38739.000000</td>\n",
       "      <td>5754.000000</td>\n",
       "      <td>585787.000000</td>\n",
       "      <td>48208.000000</td>\n",
       "      <td>12483.000000</td>\n",
       "      <td>9054.000000</td>\n",
       "      <td>3833.000000</td>\n",
       "      <td>191.000000</td>\n",
       "      <td>421.000000</td>\n",
       "      <td>59.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           n_folder      n_follow     n_followed    n_question       n_topic  \\\n",
       "count  72756.000000  72756.000000   72756.000000  72756.000000  72756.000000   \n",
       "mean     166.097449    154.171697     181.636525    263.631962     47.154475   \n",
       "std      722.466493    309.684321    4154.572286    943.775703    134.809435   \n",
       "min        0.000000      0.000000       0.000000      0.000000      0.000000   \n",
       "25%        9.000000     22.000000       1.000000     15.000000      5.000000   \n",
       "50%       28.000000     67.000000       5.000000     53.000000     18.000000   \n",
       "75%       86.000000    166.000000      16.000000    187.000000     45.000000   \n",
       "max    38739.000000   5754.000000  585787.000000  48208.000000  12483.000000   \n",
       "\n",
       "         n_zhuanlan         ans_v       share_v         ask_v       store_v  \n",
       "count  72756.000000  32346.000000  32346.000000  32346.000000  32346.000000  \n",
       "mean      28.707900     15.140543      0.152878      1.761918      6.217461  \n",
       "std       83.416237     63.209168      2.240585      6.341811      8.313293  \n",
       "min        0.000000      0.000000      0.000000      0.000000      0.000000  \n",
       "25%        2.000000      0.000000      0.000000      0.000000      1.000000  \n",
       "50%        8.000000      2.000000      0.000000      0.000000      3.000000  \n",
       "75%       27.000000     11.000000      0.000000      2.000000      9.000000  \n",
       "max     9054.000000   3833.000000    191.000000    421.000000     59.000000  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_zhihu.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 知乎用户都是哪里人？\n",
    "根据“居住地”字段判断。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False    41171\n",
       "True     31585\n",
       "Name: 居住地, dtype: int64"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 统计居住地信息(粗略统计，没有排除NaN值)\n",
    "data_zhihu.居住地.notnull().value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "北京    4631\n",
       "广东    4354\n",
       "上海    3417\n",
       "江苏    2186\n",
       "浙江    1918\n",
       "Name: 居住地, dtype: int64"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 获取居住地非空的DataFrame，赋值给data_zhihu_notnull\n",
    "data_zhihu_notnull = data_zhihu[data_zhihu.居住地.notnull()]\n",
    "\n",
    "# 统计data_zhihu_notnull中的居住地非空的信息，返回一个Series\n",
    "location_S = data_zhihu_notnull.居住地.value_counts().head(5)\n",
    "\n",
    "# 获取Series中排名前5的居住地\n",
    "location_S"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 5 artists>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAD8CAY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PtH/6QzOXVdUPxz0XaRBjL0kN8Dh7SWqAsZekBhh7SWqAsZekBhh7SWrA/wMisXGnAqW2OAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# 解决中文乱码问题\n",
    "plt.rcParams[\"font.sans-serif\"] = \"SimHei\"\n",
    "\n",
    "x = ['北京','广东','上海','江苏','浙江']\n",
    "plt.bar(x,location_S)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
